package JavaEE初阶.Multi;

import java.util.concurrent.Semaphore;

public class Demo06 {
    public static void main(String[] args) throws InterruptedException {
        Semaphore semaphore = new Semaphore(1);
        semaphore.acquire();
        System.out.println("进行了一个P操作");

        semaphore.release();
        System.out.println("释放了资源之后");

        semaphore.acquire();
        System.out.println("进行了第二次的P操作");

    }
}
